package com.tutorial.bf.dao.impl;

import com.tutorial.bf.dao.UserDao;
import com.tutorial.bf.service.UserService;
import org.springframework.beans.factory.BeanFactoryAware;

public class UserDaoImpl implements UserDao {
    public UserDaoImpl() {
        System.out.println("userDao创建");
    }

    private UserService userService;

    /**
     *
     */
    @Override
    public void show() {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("show执行啦......");

    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }
    /*private String userName;

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public UserDaoImpl() {
        System.out.println("userDao实例化");
    }

    public void init() {
        System.out.println("init初始化方法执行");
    }
    *//**
     * Invoked by the containing {@code BeanFactory} after it has set all bean properties
     * and satisfied {@link BeanFactoryAware}, {@code ApplicationContextAware} etc.
     * <p>This method allows the bean instance to perform validation of its overall
     * configuration and final initialization when all bean properties have been set.
     *
     * @throws Exception in the event of misconfiguration (such as failure to set an
     *                   essential property) or if initialization fails for any other reason
     *//*
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("属性设置之后的方法");
    }*/
}
